/*
 * @Author: 轻语
 * @Date: 2021-12-29 17:41:29
 * @LastEditors: 轻语
 * @LastEditTime: 2021-12-30 17:28:58
 * @Description: goods
 */

import { post, get } from '@/api/fetch'

const map = new Map([
  ['list', [get, 'list', true]],
  ['detail', [post, 'detail']]
])


const API = {}
for (let [key, [http, k, isMock = false]] of map) {
  API[key] = (params) => {
    console.log(params, 'params')
    return http(`goods/${k}`,  {params, isMock })
  }
}

export default API
